From 1c57a9e1168fe5773a3c17195c1d88c0aba6ac96 Mon Sep 17 00:00:00 2001 From: "kaf24@firebug.cl.cam.ac.uk" Date: Wed, 10 Aug 2005 16:03:31 +0000 Subject: [PATCH] Small time fixes. Signed-off-by: Keir Fraser --- .../arch/xen/i386/kernel/time.c | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c b/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c index fe40dfd759..4e30c2ec83 100644 --- a/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c +++ b/linux-2.6-xen-sparse/arch/xen/i386/kernel/time.c @@ -209,8 +209,6 @@ void init_cpu_khz(void) cpu_khz = __cpu_khz >> -info->tsc_shift; else cpu_khz = __cpu_khz << info->tsc_shift; - printk(KERN_INFO "Xen reported: %lu.%03lu MHz processor.\n", - cpu_khz / 1000, cpu_khz % 1000); } static u64 get_nsec_offset(struct shadow_time_info *shadow) @@ -794,13 +792,15 @@ void __init time_init(void) } #endif get_time_values_from_xen(); - update_wallclock(); - set_normalized_timespec(&wall_to_monotonic, - -xtime.tv_sec, -xtime.tv_nsec); + processed_system_time = per_cpu(shadow_time, 0).system_timestamp; per_cpu(processed_system_time, 0) = processed_system_time; + update_wallclock(); + init_cpu_khz(); + printk(KERN_INFO "Xen reported: %lu.%03lu MHz processor.\n", + cpu_khz / 1000, cpu_khz % 1000); #if defined(__x86_64__) vxtime.mode = VXTIME_TSC; @@ -875,15 +875,13 @@ void time_resume(void) { init_cpu_khz(); - /* Get timebases for new environment. */ get_time_values_from_xen(); - update_wallclock(); - /* Reset our own concept of passage of system time. */ - processed_system_time = - per_cpu(shadow_time, smp_processor_id()).system_timestamp; + processed_system_time = per_cpu(shadow_time, 0).system_timestamp; per_cpu(processed_system_time, 0) = processed_system_time; + update_wallclock(); + per_cpu(timer_irq, 0) = bind_virq_to_irq(VIRQ_TIMER); (void)setup_irq(per_cpu(timer_irq, 0), &irq_timer); } -- 2.30.2